home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / skey_sun.pro < prev    next >
Text File  |  1997-07-08  |  2KB  |  79 lines

  1. ; $Id: skey_sun.pro,v 1.4 1997/03/05 19:20:58 ali Exp $
  2. ;
  3. ; Copyright (c) 1989-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5.  
  6. pro skey_sun, psterm=psterm
  7. ;+
  8. ; NAME:
  9. ;    SKEY_SUN
  10. ;
  11. ; PURPOSE:
  12. ;    Under Unix, the number of function keys, their names, and the
  13. ;    escape sequences they send to the host computer vary
  14. ;    enough between various keyboards that IDL cannot be
  15. ;    written to understand all keyboards. Therefore, it provides
  16. ;    a very general routine named DEFINE_KEY that allows the
  17. ;    user to specify the names and escape sequences. This
  18. ;    routine uses DEFINE_KEY to enter the keys for a Sun keyboard.
  19. ;
  20. ;    Note: SKEY_SUN is primarily designed to be called by
  21. ;    SETUP_KEYS, which attempts to automatically detect the correct
  22. ;    keyboard type in use, and define the keys accordingly.
  23. ;    Nonetheless, SKEY_SUN can be called as a standalone
  24. ;    routine.
  25. ;
  26. ; CATEGORY:
  27. ;    Misc.
  28. ;
  29. ; CALLING SEQUENCE:
  30. ;    SKEY_SUN
  31. ;
  32. ; INPUTS:
  33. ;    None.
  34. ;
  35. ; KEYWORD PARAMETERS:
  36. ;    None.
  37. ;
  38. ; OUTPUTS:
  39. ;    None.
  40. ;
  41. ; COMMON BLOCKS:
  42. ;    None.
  43. ;
  44. ; SIDE EFFECTS:
  45. ;    The definitions for the function keys have been entered, and
  46. ;    can be viewed using the command HELP, /KEYS .
  47. ;
  48. ; MODIFICATION HISTORY:
  49. ;    AB, 26 April 1989
  50. ;    TJA, July 1990, SETUP_KEYS_SUN created by the "breakup" of SETUP_KEYS
  51. ;            into separate files.
  52. ;    AB, 21 September 1992,renamed from SETUP_KEYS_SUN to SKEY_SUN to
  53. ;        avoid DOS filename limitations.
  54. ;    AB, 16 June 1993, The IDL scanner used to treat octal string escapes
  55. ;        in a manner similar to the C language, but this ability was
  56. ;        removed to make the MS DOS port possible (conflicts with
  57. ;        file path specifications). Removed all uses of that here.
  58. ;    AB, 5 March 1997, The psterm doesn't exist anymore, so I changed the
  59. ;        routine to accept the PSTERM keyword and silently ignore it.
  60. ;-
  61.  
  62. CSI=string(27B)+'['
  63.  
  64. ; F1-F9
  65. for i=1,9 do define_key,'F'+strtrim(i,2),escape=CSI+strtrim(i+223,2)+'z'
  66.  
  67. ; R1 - R15
  68. for i=1,15 do define_key,'R'+strtrim(i,2),escape=CSI+strtrim(i+207,2)+'z'
  69.  
  70. ; Arrow keys in function code mode, and R13, R15
  71. define_key, 'R8', /PREVIOUS_LINE
  72. define_key, 'R10', /BACK_CHARACTER
  73. define_key, 'R12', /FORWARD_CHARACTER
  74. define_key, 'R13', /BACK_WORD
  75. define_key, 'R14', /NEXT_LINE
  76. define_key, 'R15', /FORWARD_WORD
  77. return ; Sun3 keyboard
  78. end
  79.